package com.ruoyi.map.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.map.domain.District;
import com.ruoyi.map.domain.Province;
import com.ruoyi.map.service.MapService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author LiSuxuan
 * @date 2021年 08月 27日 15:41
 */
@Api("地区获取类")
@Slf4j
@RestController
@RequestMapping("/region")
public class RegionController extends BaseController {

    @Autowired
    private MapService mapService;

    public AjaxResult treeSelect(List<District> districts) {
        List<District> districtList = new ArrayList<>();
        for (District district : districts) {

        }

        return AjaxResult.success();
    }

    /**
     * 获取全国地区树状结构
     *
     * @return 列表
     */
    @ApiOperation(value = "获取全国地区树状结构", notes = "")
    @GetMapping("/allRegionTree")
    public AjaxResult allRegionTree() {
        return AjaxResult.success(mapService.getAllMap());
    }


}
